package aop.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author quan
 * @Description 写博客页面、编辑博客、删除博客页面
 * @Date 2023/7/26 17:15
 */
@Slf4j
@RequestMapping("/aop")
@RestController
public class UserController {
    //模拟写博客
    @RequestMapping("/writeBlog")
    public String writeBlog(){
        //模拟异常
//        int a = 10/0;
        log.info("write blog success...");
        return "write blog success...";
    }
    //编辑博客
    @RequestMapping("/editBlog")
    public String editBlog(){
        log.info("edit blog success...");
        return "edit blog success...";
    }
    //删除博客
    @RequestMapping("/deleteBlog")
    public String deleteBlog(){
//        long start = System.currentTimeMillis();
        log.info("deleteBlog success...");
//        long end = System.currentTimeMillis();
//        log.info("log方法耗时"+(end-start));
        return "deleteBlog success...";
    }
}
